package demo2;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2022-11-16
 * Time: 18:46
 */
interface IShape {
    public abstract void draw();
    default public void func() {
        System.out.println("fsafa");
    }
}

class Rect implements IShape {
    @Override
    public void draw() {
        System.out.println("♦");
    }

/*    @Override
    public void func() {
        System.out.println("重写接口当中的默认方法");
    }*/
}

public class Test {

    public static void drawMap(IShape iShape) {
        iShape.draw();
    }

    public static void main(String[] args) {
        Rect rect = new Rect();

    }
    public static void main1(String[] args) {
        IShape iShape = new Rect();
        iShape.draw();
    }
}


















